/**********************************************************************************************************************
 *
 * Project:    mGameEngine
 * File:       directionalblur.h
 * Author:     twoja stara
 * Created on: 2010-05-30
 *
 **********************************************************************************************************************/

#ifndef DIRECTIONALBLUR_H_
#define DIRECTIONALBLUR_H_

#include "postprocess.h"
#include "gpuprogram.h"

namespace mGameEngine
{
namespace Graphics
{

/**
 * TODO
 */
class DirectionalBlur: public PostProcess
{
protected:
    /**
     * Direction angle.
     */
    float _angle;

    /**
     * Size.
     */
    float _size;

public:
    /**
     * Create new directional blur post-process.
     * @param angle direction angle in radians.
     * @param size blur size.
     * @param texture input image texture.
     * @param target output render target.
     */
    DirectionalBlur(float angle = 0.0f, float size = 5.0f,
                    const Texture *texture = NULL, RenderTarget *target = NULL);

    /**
     * Destroy directional blur post-process.
     */
    virtual ~DirectionalBlur();

    /**
     * Get blur direction angle.
     * @return blur direction angle in radians.
     */
    float getDirectionAngle() const
    {
        return _angle;
    }

    /**
     * Set blur direction angle.
     * @param angle direction angle in radians.
     */
    void setDirectionAngle(float angle)
    {
        _angle = angle;
    }

    /**
     * Get blur size.
     * @return blur size.
     */
    float getSize() const
    {
        return _size;
    }

    /**
     * Set blur size.
     * @param size size.
     */
    void setSize(float size)
    {
        if(size < 0.0f)
        {
            return;
        }

        _size = size;
    }

    /**
     * Blur input image and pass to output render target.
     */
    virtual void process() const;
};

}
}

#endif // DIRECTIONALBLUR_H_
